package site.koudai.cloud.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Select;
import site.koudai.cloud.entity.Permission;

import java.util.List;

public interface PermissionMapper extends BaseMapper<Permission> {

    @Select("select * from permission where id in (select permission_id from role_permission where role_id in (select role_id from user_role where user_id = #{userId}))")
    List<Permission> getPermissionsByUserId(Integer userId);

}
